package com.qiall.boot.fileservice.data.eitity.enums;

import com.qiall.common.service.BaseEnumsService;

public enum UploadStatusEnum implements BaseEnumsService {
    /**
     * 上传中
     */
    上传中((byte) 1, "上传中"),
    /**
     * 已上传
     */
    已上传((byte) 2, "已上传");

    private byte code;
    private String desc;

    UploadStatusEnum(byte code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    @Override
    public byte getCode() {
        return code;
    }

    public static UploadStatusEnum ofCode(Byte code) {
        for (UploadStatusEnum uploadStatusEnum : UploadStatusEnum.values()) {
            if (uploadStatusEnum.code == code) {
                return uploadStatusEnum;
            }
        }
        return null;
    }
}
